from django.contrib import admin
from .models import *

# Roles
# Menu
# Permission
# Register your models here.
@admin.register(Roles)
class RolesAdmin(admin.ModelAdmin):
     # 显示的列表信息
    list_display = ('id','name','desc')
    # # 查询过滤的字段
    list_filter = ('name',)
    list_editable =('name','desc')
    # # 分页，每页显示条数
    # list_per_page = 20

@admin.register(Menu)
class MenuAdmin(admin.ModelAdmin):
     # 显示的列表信息
    list_display = ('id','title','icon','order')
    # # 查询过滤的字段
    list_filter = ('title','icon',)
    list_editable =('title',)
    # # 分页，每页显示条数
    # list_per_page = 20

@admin.register(Permission)
class PermissionAdmin(admin.ModelAdmin):
     # 显示的列表信息
    list_display = ('id','title','name','url','component','icon','menu','order')
    # # 查询过滤的字段
    list_filter = ('title','menu')
    list_editable =('title','url','component','icon','menu','order')
    # # 分页，每页显示条数
    # list_per_page = 20

@admin.register(RolesUser)
class RolesUserAdmin(admin.ModelAdmin):
     # 显示的列表信息
    list_display = ('id',)